﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LdtJudge.DataEngine.DataBaseStores
{
    /// <summary>
    /// 上下文处理对象
    /// </summary>
    public class DataContext
    {
        /// <summary>
        /// 全流程上下文对象
        /// </summary>
        /// <param name="dataLayerSys">系统配置信息</param>
        /// <param name="dataLayerAns">分析相关对象</param>
        /// <param name="dataLayerOpt">优选对象</param>
        /// <param name="interactiveShow">交互对象</param>
        public DataContext(DataLayerSysStores dataLayerSys, DyData_Analysis dataLayerAns, DyData_Optimize dataLayerOpt, InteractiveShowClass interactiveShow)
        {
            DataLayerSys= dataLayerSys;
            DataLayerAns = dataLayerAns;
            DataLayerOpt = dataLayerOpt;
            InteractiveShow = interactiveShow;
        }
        /// <summary>
        /// 分析卷宗初始化上下文对象
        /// </summary>
        /// <param name="dataLayerSys">系统配置信息</param>
        /// <param name="dataLayerAns">分析相关对象</param>
        /// <param name="interactiveShow">交互对象</param>
        public DataContext(DataLayerSysStores dataLayerSys, DyData_Analysis dataLayerAns,InteractiveShowClass interactiveShow):this(dataLayerSys, dataLayerAns,null, interactiveShow)
        {
            
        }
        /// <summary>
        /// 优选案件初始化上下文数据
        /// </summary>
        /// <param name="dataLayerSys">系统配置信息</param>
        /// <param name="dataLayerOpt">优选对象</param>
        /// <param name="interactiveShow">交互对象</param>
        public DataContext(DataLayerSysStores dataLayerSys, DyData_Optimize dataLayerOpt, InteractiveShowClass interactiveShow):this(dataLayerSys, null, dataLayerOpt, interactiveShow)
        {
        }
        ///<summary>
        /// 系统配置对象
        ///</summary> 
        public DataLayerSysStores DataLayerSys  { get; }


        ///<summary>
        /// 案件分析对象
        ///</summary> 
        public DyData_Analysis DataLayerAns  { get; set; }


        ///<summary>
        /// 案件优选对象
        ///</summary> 
        public DyData_Optimize DataLayerOpt  { get; }


        /// <summary>
        /// 获取基础数据
        /// </summary>
        public DyDataBase DataCommon 
        {
            get =>DataLayerAns != null ? DataLayerAns as DyDataBase : DataLayerOpt as DyDataBase;
        }

        ///<summary>
        /// 数据交互对象
        ///</summary> 
        public InteractiveShowClass InteractiveShow  { get; }

        public Dictionary<object, string> dicML = new Dictionary<object, string>();
    }
}
